#!/usr/bin/env python 
# -*- coding:utf-8 -*-
# ==============================
# @author = makun
# @project = pyTest1
# @file = AkShareTest
# @create_time = 2021/11/5 10:54 PM
# ==============================

import akshare as ak
import pandas as pd
import mplfinance as mpf  # Please install mplfinance as follows: pip install mplfinance


# get_roll_yield_bar_df = ak.get_roll_yield_bar(type_method="date", var="RB", start_day="20180618", end_day="20180718", plot=True)
# print(get_roll_yield_bar_df)

# stock_sse_summary_df = ak.stock_sse_summary()
# print(stock_sse_summary_df)

# stock_zh_a_hist_df = ak.stock_zh_a_hist(symbol="300343", period="daily", start_date="20170301", end_date='20211106', adjust="")
# print(stock_zh_a_hist_df)

lhb = ak.stock_sina_lhb_detail_daily(trade_date="20211105",symbol="返回当前交易日所有可查询的指标")
print(lhb)
lhb.to_json('~/a.json',force_ascii=False)


# stock_us_daily_df = ak.stock_us_daily(symbol="AAPL", adjust="qfq")
# stock_us_daily_df = stock_us_daily_df[["open", "high", "low", "close", "volume"]]
# stock_us_daily_df.columns = ["Open", "High", "Low", "Close", "Volume"]
# stock_us_daily_df.index.name = "Date"
# stock_us_daily_df = stock_us_daily_df["2020-04-01": "2020-04-29"]
# mpf.plot(stock_us_daily_df, type='candle', mav=(3, 6, 9), volume=True, show_nontrading=False)
